--
-- Author:      name
-- DateTime:    2018-04-23 17:19:33
-- Description: 管理大厅socket, service
require "skynet.manager"
local skynet = require "skynet"
local cluster = require "cluster"

local Objects = require "Objects"
local Command = require "Command"
local Message = require "Message"

g_objects = Objects.new()

local function init()
	local message = Message.new()	
	g_objects:add(message)
	local command = Command.new(message)
	g_objects:add(command)
	g_objects:hotfix()
	skynet.dispatch("lua", message:dispatch())		
end


---------------------------------------------------------
-- skynet
---------------------------------------------------------

skynet.start(function()
	init()
	skynet.register('.proxy')
	--集群节点
	local svr_id = skynet.getenv("svr_id")
	cluster.open(svr_id)	
end)